Merged
Conversation
Introduce scheduler system notifications: - Add a new notifications.py module that implements queued, styled toast windows for scheduler events (start, finished_exited, finished_killed, error) - Integrate notifications into the GUI by adding a Notification button with an on/off toggle, building notification payloads, and emitting toasts at schedule start/finish/kill/error points - Persist the scheduler_notification_enabled flag via new load/save functions in config.py - Add QSS styles for notification widgets and ensure theme updates propagate to visible notifications
- Replace textual close button with a styled icon button (drawn QIcon) and add hover tooltip/hover-state via an event filter; adjust notification layout margins and spacing. - Update stylesheet for notification close button (border, sizing, hover/pressed colors). - Show seconds in next-run formatting (return "in 0s" and "in Ns" for <60s) and use format_rule_display for schedule rule labels in the GUI. Also change trash SVG stroke to red.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds system notifications for scheduler events: toasts appear in the bottom-right of the screen when a scheduled run starts, finishes (exited/killed), or errors. Notifications can be turned on or off from the toolbar and follow the app theme.
Changes
Config
scheduler_notification_enabledinconfig.jsonwithload_scheduler_notification_enabled()/save_scheduler_notification_enabled()inconfig.py.New module:
src/notifications.pyshow_notification(event_type, schedule_name, script_name, rule_type, next_run, palette, error_message=None)– shows a toast with preformatted strings (no schedule dicts or scheduler engine).update_notification_theme(palette)– updates the current toast when the user switches theme.notificationToast, bottom-right placement, topmost, 4s auto-close, close button with drawn X icon and "Close notification" tooltip. Styled via existing palette intheme.py.GUI (
gui.py)_format_next_run_for_notification()(time:on HH:MM dd/mm/yy, interval:in Xh Ymor seconds when < 1 min),_build_notification_payload()(usesformat_rule_display()for rule text),_get_schedule_and_history_for_id()to resolve schedule from history._execute_scheduled_run).run_script_in_gitbash_captured).check_processeswhen process exits)._kill_script_rowand when scheduler kills before next run in_execute_scheduled_run)._toggle_theme()callsupdate_notification_theme(self._palette)so toasts follow light/dark.Theme (
theme.py)#notificationToast,#notificationTitle,#notificationBody,#notificationError, and#notificationCloseBtn(red border/icon, hover state) using existing palette keys.Behavior
gui.py→notifications; notifications receive only strings and palette, noscheduler_engineor schedule dicts.